Loopless generation of multiset permutations using a constant number of variables by prefix shifts
نویسنده
چکیده
This paper answers the following mathematical question: Can multiset permutations be ordered so that each permutation is a prefix shift of the previous permutation? Previously, the answer was known for the permutations of any set, and the permutations of any multiset whose corresponding set contains only two elements. This paper also answers the following algorithmic question: Can multiset permutations be generated by a loopless algorithm that uses sublinear additional storage? Previously, the best loopless algorithm used a linear amount of additional storage. The answers to these questions are both yes.
منابع مشابه
Loopless Generation of Multiset Permutations by Prefix Shifts
This paper answers the following mathematical question: Can multiset permu-tations be ordered so that each permutation is a prefix shift of the previous permutation?Previously, the answer was known for the permutations of any set, and the permutationsof any multiset whose corresponding set contains only two elements. This paper also an-swers the following algorithmic question: C...
متن کاملGenerating Balanced Parentheses and Binary Trees by Prefix Shifts
We show that the set Bn of balanced parenthesis strings with n left and n right parentheses can be generated by prefix shifts. If b1, b2, . . . , b2n is a member of Bn, then the k-th prefix shift is the string b1, bk, b2, . . . , bk−1, bk+1, . . . , b2n. Prefix shift algorithms are also known for combinations, and permutations of a multiset; the combination algorithm appears in fascicles of Knu...
متن کاملCombinatorial Generation by Fusing Loopless Algorithms
Some combinatorial generation problems can be broken into subproblems for which loopless algorithms already exist. We discuss means by which loopless algorithms can be fused to produce a new loopless algorithm that solves the original problem. We demonstrate this method with two new loopless algorithms, MIXPAR and MULTPERM. MIXPAR generates well-formed parenthesis strings containing two differe...
متن کاملRanking and Loopless Generation of k-ary Dyck Words in Cool-lex Order
A binary string B of length n = kt is a k-ary Dyck word if it contains t copies of 1, and the number of 0s in every prefix of B is at most k−1 times the number of 1s. We provide two loopless algorithms for generating k-ary Dyck words in cool-lex order: (1) The first requires two index variables and assumes k is a constant; (2) The second requires t index variables and works for any k. We also e...
متن کاملFusing Loopless Algorithms for Combinatorial Generation
Loopless algorithms are an interesting challenge in the field of combinatorial generation. These algorithms must generate each combinatorial object from its predecessor in no more than a constant number of instructions, thus achieving theoretically minimal time complexity. This constraint rules out powerful programming techniques such as iteration and recursion, which makes loopless algorithms ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009